package leetcode.秋招.小米;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author ：zsy
 * @date ：Created 2021/9/1 18:47
 * @description：
 */
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        String s1 = in.nextLine();
        String s2 = in.nextLine();
        String[] ss = s.split(",");
        int m = ss[0].charAt(2) - '0';
        int n = ss[1].charAt(2) - '0';
        int[] nums = new int[m + n];
        String[] s1s = s1.split(",");
        int index = 0;
        for(int i = 0; i < s1s.length; i++) {
            nums[index++] = Integer.parseInt(s1s[i]);
        }
        String[] s2s = s2.split(",");
        for(int i = 0; i < s2s.length; i++) {
            nums[index++] = Integer.parseInt(s2s[i]);
        }
        Arrays.sort(nums);
        for (int num : nums) {
            System.out.print(num);
        }
    }
}
